﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>用户管理</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link href="../demo.css" rel="stylesheet" type="text/css" />
    <script src="../../scripts/boot.js" type="text/javascript"></script>
    <style type="text/css">
    html,body
    {
        width:100%;
        height:100%;
        border:0;
        margin:0;
        padding:0;
        overflow:visible;
    }
    </style>
</head>
<body >   
    
    <h1 id="versions"> 当前版本V1</h1>
    <button onclick="updateVersions();">版本更新</button> 
    <h1>版本发布</h1>
    <button id="versions22" onclick="updateVersions22();">版本发布</button> 
    <h1> 上下线获取积分比例配置</h1>
    <div id="editform"  class="form">
   		 <input name="number" id="number" required="true"  vtype="range:1,99"  class="mini-textbox"  />
    </div>
    <button onclick="updateRatio()">保存</button> 	
    <h1> 获取积分间隔时间配置</h1>
    <div id="editform1"  class="form">
   		 <input name="interval" id="interval" required="true"  vtype="range:1,60"  class="mini-textbox"  />分
    </div>
    <button onclick="updateInterval()">保存</button>
     <h1> 获取积分最大值配置</h1>
    <div id="editform2"  class="form">
   		 <input name="integral" id="integral" required="true"  vtype="range:1,10000"  class="mini-textbox"  />
    </div>
    <button onclick="updateIntegral()">保存</button> 
    
    <h1> 兑换间隔时间配置</h1>
    <div id="editform3"  class="form">
   		 <input name="exchange" id="exchange" required="true"  vtype="float" class="mini-textbox"  />时
    </div>
    <button onclick="updateExchange()">保存</button>
    
      <h1> 同一IP的最大用户数配置</h1>
    <div id="editform4"  class="form">
   		 <input name="usernum" id="usernum" required="true"  vtype="range:1,100"  class="mini-textbox"  />
    </div>
    <button onclick="updateUsernum()">保存</button>
    
        <h1> 版本参数配置</h1>
    <div id="editform5"  class="form">
   		 <input name="isf" id="isf" required="true"    class="mini-textbox"  />
    </div>
      <div id="editform6"  class="form">
   		 <input name="YesNo" id="YesNo" required="true"  class="mini-textbox"  />
    </div>
    <button onclick="updateVersions()">保存</button>
    
    <h1> 更新内容配置</h1>
      <div id="editform7"  class="form">
   		 <input name="updateInfo" id="updateInfo" required="true"  class="mini-textbox"  style="width:600px"  />
    </div>
    <button onclick="updateUpdateInfo()">保存</button>
    
        <h1> AA:BB:CC最大允许的用户数配置</h1>
      <div id="editform8"  class="form">
   	 <input name="usernum1" id="usernum1" required="true"  vtype="range:1,100"  class="mini-textbox"  />
    </div>
    <button onclick="updateUsernum1()">保存</button>
    
        <h1> AA:BB最大允许的用户数配置</h1>
      <div id="editform9"  class="form">
   		 <input name="usernum2" id="usernum2" required="true"  vtype="range:1,100"  class="mini-textbox"  />
    </div>
    <button onclick="updateUsernum2()">保存</button>
    
         <h1> vip奖励积分配置</h1>
      <div id="editform10"  class="form">
   		 <input name="vipnum" id="vipnum" required="true"  vtype="range:1,10000"  class="mini-textbox"  />
    </div>
    <button onclick="updatevipnum()">保存</button>
    
         <h1> 同一个区域获取的相同积分个数最大配置</h1>
      <div id="editform11"  class="form">
   		 <input name="num" id="num" required="true"  vtype="range:1,100"  class="mini-textbox"  />
    </div>
    <button onclick="updateNum()">保存</button>
    
         <h1> 同一个Q号每日兑换QB最大数配置</h1>
      <div id="editform12"  class="form">
   		 <input name="QBnumD" id="QBnumD" required="true"  vtype="range:1,10000"  class="mini-textbox"  />
    </div>
    <button onclick="updateQBNumD()">保存</button>
    
       <h1> 同一个Q号每月兑换QB最大数配置</h1>
      <div id="editform13"  class="form">
   		 <input name="QBnumM" id="QBnumM" required="true"  vtype="range:1,10000"  class="mini-textbox"  />
    </div>
    <button onclick="updateQBNumM()">保存</button>
    
       <h1> 同一个手机号每日兑换话费最大数配置</h1>
      <div id="editform14"  class="form">
   		 <input name="HFnumD" id="HFnumD" required="true"  vtype="range:1,10000"  class="mini-textbox"  />
    </div>
    <button onclick="updateHFNumD()">保存</button>
    
       <h1> 同一个手机号每月兑换话费最大数配置</h1>
      <div id="editform15"  class="form">
   		 <input name="HFnumM" id="HFnumM" required="true"  vtype="range:1,10000"  class="mini-textbox"  />
    </div>
    <button onclick="updateHFNumM()">保存</button>
    
          <h1> 24小时内同一渠道/同一任务相同积分的个数最大数配置</h1>
      <div id="editform16"  class="form">
   		 <input name="numMax" id="numMax" required="true"  vtype="range:1,1000"  class="mini-textbox"  />
    </div>
    <button onclick="updatenumMax()">保存</button>
         <h1> 推送间隔配置</h1>
      <div id="editform17"  class="form">
   		 <input name="pushInterval" id="pushInterval" required="true"  vtype="range:1,1000"  class="mini-textbox"  />秒
    </div>
    <button onclick="updatepushInterval()">保存</button>
    <h1> 自动充值配置</h1>
   <div id="recharge" name="recharge" class="mini-checkbox" checked="false"  readOnly="false" 
   text="打开自动充值" onvaluechanged="onValueChanged"></div>
   <!-- div> <button onclick="autoRecharge()" id="autoRecharge">一键充值</button></div-->
   
    <script type="text/javascript">
 		mini.parse();
 		
 		 $.ajax({
              url: "/ios/pages/User/settingList.do",
              success: function (text) {
                 var o = mini.decode(text);
           			   if(o.state){
                    	  mini.get("number").setValue(o.ratio);
                    	  mini.get("interval").setValue(o.interval);
                    	  mini.get("integral").setValue(o.integral);
                    	  mini.get("exchange").setValue(o.exchange);
                    	  mini.get("usernum").setValue(o.usernum);
                    	  mini.get("usernum1").setValue(o.usernum1);
                    	  mini.get("usernum2").setValue(o.usernum2);
                    	  mini.get("vipnum").setValue(o.vipnum);
                    	  mini.get("isf").setValue(o.isf);
                    	  mini.get("YesNo").setValue(o.YesNo);
                    	  mini.get("updateInfo").setValue(o.updateInfo);
                    	  mini.get("num").setValue(o.num);
                    	  mini.get("QBnumD").setValue(o.QBnumD);
                    	  mini.get("QBnumM").setValue(o.QBnumM);
                    	  mini.get("HFnumD").setValue(o.HFnumD);
                    	  mini.get("HFnumM").setValue(o.HFnumM);
                    	  mini.get("numMax").setValue(o.numMax);
                    	  mini.get("pushInterval").setValue(o.pushInterval);
                    	  if(o.recharge=="true")mini.get("recharge").setChecked(true);
                    	  $('#versions').html('当前版本V'+o.versions);
                    	  $('#versions22').html('当前版本('+o.YesNo+')');
                    	  // mini.get("versions22").setValue(o.YesNo);
           			   }else{
           			      mini.alert("请求出错了");
           			   }
              },
              error: function () {
             		mini.hideMessageBox(messageid);
             		mini.alert("删除出错");
              }
          });
 		
 		var form = new mini.Form("#editform");
 		var form1 = new mini.Form("#editform1");
 		var form2 = new mini.Form("#editform2");
 		var form3 = new mini.Form("#editform3");
 		var form4 = new mini.Form("#editform4");
 		
 		var form7 = new mini.Form("#editform7");
 		var form8 = new mini.Form("#editform8");
 		var form9 = new mini.Form("#editform9");
 		var form10 = new mini.Form("#editform10");
 		var form11 = new mini.Form("#editform11");
 		
 		var form12 = new mini.Form("#editform12");
 		var form13 = new mini.Form("#editform13");
 		var form14 = new mini.Form("#editform14");
 		var form15 = new mini.Form("#editform15");
 		var form16 = new mini.Form("#editform16");
 		var form17 = new mini.Form("#editform17");
        function updateVersions() {
         	mini.confirm("您确定软件版本进行了更新？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/versions.do",
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }else{
	                  return;
	               }
            },true);
        }
        
        
         function updateVersions22() {
         	mini.confirm("您确定要更新新的版本吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/setYesNo.do",
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }else{
	                  return;
	               }
            },true);
        }
        
        function updateRatio() {
        	form.validate();
            if (form.isValid() == false) return;
         	mini.confirm("您确定要修改要修改上下分成比例吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var number = mini.get("number").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/ratio.do?number="+number,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }
        
        function updateInterval() {
        	form1.validate();
            if (form1.isValid() == false) return;
         	mini.confirm("您确定要修改间隔时间吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var interval = mini.get("interval").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/interval.do?interval="+interval,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }
        
        function updateIntegral() {
        	form2.validate();
            if (form2.isValid() == false) return;
         	mini.confirm("您确定要修改积分配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var integral = mini.get("integral").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/integral.do?integral="+integral,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }
        
        function updateExchange() {
        	form3.validate();
            if (form3.isValid() == false) return;
         	mini.confirm("您确定要修改兑换间隔时间配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var exchange = mini.get("exchange").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/exchange.do?exchange="+exchange,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }
        
        function updateUsernum() {
        	form4.validate();
            if (form4.isValid() == false) return;
         	mini.confirm("您确定要修改同一IP的最大用户数配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var usernum = mini.get("usernum").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/usernum.do?usernum="+usernum,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }
        
        function updateNum() {
        	form11.validate();
            if (form11.isValid() == false) return;
         	mini.confirm("您确定要修改同一个区域获取的相同积分个数最大配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var num = mini.get("num").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/num.do?num="+num,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }
        
        function updateUsernum1() {
        	form8.validate();
            if (form8.isValid() == false) return;
         	mini.confirm("您确定要修改AA:BB:CC最大允许的用户数配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var usernum1= mini.get("usernum1").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/usernum1.do?usernum1="+usernum1,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }
        
        function updateUsernum2() {
        	form9.validate();
            if (form9.isValid() == false) return;
         	mini.confirm("您确定要修改AA:BB最大允许的用户数配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var usernum2 = mini.get("usernum2").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/usernum2.do?usernum2="+usernum2,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }
        
        function updatevipnum() {
        	form10.validate();
            if (form10.isValid() == false) return;
         	mini.confirm("您确定要修改vip用户奖励积分配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var vipnum = mini.get("vipnum").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/vipnum.do?vipnum="+vipnum,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }
        
        function updateVersions() {
        	//form4.validate();
        //    if (form4.isValid() == false) return;
         	mini.confirm("您确定要修改版本参数配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var isf = mini.get("isf").getValue();
	                    var YesNo = mini.get("YesNo").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/updateVersions.do?isf="+isf+"&YesNo="+YesNo,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }
        
        function updateUpdateInfo() {
        	form7.validate();
            if (form7.isValid() == false) return;
            var data = form7.getData();
            var json = mini.encode(data)
         	mini.confirm("您确定要修改更新内容配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                  //  var updateInfo = mini.get("updateInfo").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/updateUpdateInfo.do",
		                    type: "post",
		                    data: {submitData:json },
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }
        
        function updateQBNumD() {
        	form12.validate();
            if (form12.isValid() == false) return;
         	mini.confirm("您确定要修改同一个Q号每日兑换QB最大数配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var QBnumD = mini.get("QBnumD").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
                    	
		                $.ajax({
		                    url: "/ios/pages/User/QBnumD.do?QBnumD="+QBnumD,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }  
        
        function updateQBNumM() {
        	form13.validate();
            if (form13.isValid() == false) return;
         	mini.confirm("您确定要修改同一个Q号每月兑换QB最大数配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var QBnumM = mini.get("QBnumM").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/QBnumM.do?QBnumM="+QBnumM,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }  
        
        function updateHFNumD() {
        	form14.validate();
            if (form14.isValid() == false) return;
         	mini.confirm("您确定要修改同一个手机号每日兑换话费最大数配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var HFnumD = mini.get("HFnumD").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/HFnumD.do?HFnumD="+HFnumD,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }  
        
        function updateHFNumM() {
        	form15.validate();
            if (form15.isValid() == false) return;
         	mini.confirm("您确定要修改同一个手机号每月兑换话费最大数配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var HFnumM = mini.get("HFnumM").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/HFnumM.do?HFnumM="+HFnumM,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }  
        
        function updatenumMax() {
        	form16.validate();
            if (form16.isValid() == false) return;
         	mini.confirm("您确定要修改24小时内同一渠道相同积分的个数最大数配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var numMax = mini.get("numMax").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/numMax.do?numMax="+numMax,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        }
        
        function updatepushInterval() {
        	form17.validate();
            if (form17.isValid() == false) return;
         	mini.confirm("您确定要修改推送时间间隔配置吗？", "确定？",
	            function (action, value) {            
	                if (action == "ok") {
	                    var pushInterval = mini.get("pushInterval").getValue();
                    	var messageid = mini.loading("正在执行...", "wait");
		                $.ajax({
		                    url: "/ios/pages/User/pushInterval.do?pushInterval="+pushInterval,
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("更新成功");
                   			   }else{
                   			      mini.alert("删除出错");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("删除出错");
		                    }
		                });
	               }
            },true);
        } 
        
        function autoRecharge() {
		                $.ajax({
		                    url: "/ios/pages/User/autoRecharge.do",
		                    success: function (text) {
		                       var o = mini.decode(text);
		                       mini.hideMessageBox(messageid);
                   			   if(o.state){
	                           	  mini.alert("正在自动充值");
                   			   }else{
                   			      mini.alert("错误");
                   			   }
		                    },
		                    error: function () {
		                   		mini.hideMessageBox(messageid);
		                   		mini.alert("错误");
		                    }
		                });
        } 
        
        function onValueChanged(e) {
            var recharge = mini.get("recharge");
            if(recharge.getChecked()==true)
            	{var str="打开自动充值";
            	var str1="true";
            	}
            else 
            	{var str="关闭自动充值";
            	var str1="false";}
           	mini.confirm("您确定要"+str+"吗？", "确定？",
    	            function (action, value) {            
    	                if (action == "ok") {
    	                	var messageid = mini.loading("正在执行...", "wait");
    	                    $.ajax({
    		                    url: "/ios/pages/User/recharge.do?recharge="+str1,
    		                    success: function (text) {
    		                       var o = mini.decode(text);
    		                       mini.hideMessageBox(messageid);
                       			   if(o.state){
    	                           	  mini.alert("更新成功");
                       			   }else{
                       				recharge.setChecked(!recharge.getChecked());
                       			      mini.alert("修改出错");
                       			   }
    		                    },
    		                    error: function () {
    		                    	recharge.setChecked(!recharge.getChecked());
    		                   		mini.hideMessageBox(messageid);
    		                   		mini.alert("修改出错");
    		                    }
    		                });
    		     
    	               }else {
    	            	   recharge.setChecked(!recharge.getChecked());
    	               }
                },true);
        } 
        
    </script>
    
    
</body>
</html>